package quantum.error.correcting.code.finalone;

import java.util.Comparator;
import java.util.Comparator;

/**
 * @author sunkai
 * @version 09-03-27
 * 
 */
public class CodeLenComparator implements Comparator<Code> {
	/*
	 * (non-Javadoc)
	 * 
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	public int compare(Code a, Code b) {
		if(a.getCodeLen()<b.getCodeLen()){
			return -1;
		}else if(a.getCodeLen()==b.getCodeLen()){
			return 0;
		}else{
			return 1;
		}
	}
}
